/*
 * @Author: your name
 * @Date: 2020-05-12 11:24:57
 * @LastEditTime: 2020-05-13 15:44:54
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /vue-cli4-multi/src/modules/mobile/main.js
 */
import Vue from 'vue'
import App from './App.vue'
import Element from 'element-ui'
import '@/registerServiceWorker'

// vuex
import store from './data/store'
import router from './router'

// 初始化样式
import 'normalize.css/normalize.css'
import './assets/styles/index.styl'
// SVG 图标
import './assets/icons'

// 全局vue模板filters过滤器
import filters from '@/common/filters'
// 全局directive指令
import directives from '@/common/directives'
// 引入正则校验
// import Validate from '@/common/validate/index.js'
// 引入自定义 全局组件
import '@components'

// Mock Server
process.env.NODE_ENV === 'development' && require('./data/mock/index')

// 注册vue模板过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
// 注册全局指令方法
Object.keys(directives).forEach(key => {
  Vue.directive(key, directives[key])
})

// 注册Element UI
Vue.use(Element, {
  size: store.getters.app.size || 'medium'
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
